<!---
	Title:		EPAR1.1 
	Author:		Bruce Frick
	Purpose:	NON SCF Step2 Request.  Calendar is constructed in the js file.
--->

<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<Cfset baseQueries = CreateObject("component", "#session.rootDir#.cfc.queries")/>
<cfset nonSCFOrientation = CreateObject("component", "#session.rootDir#.cfc.nonSCFStep2-OrientationQueries") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">

<cfoutput>
	<!---HTML header, css links, js links, and page title--->
    #BASE.htmlHeaderNonSCF(
    	"/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js, /" & Session.rootDir & "/js/nonSCFStep2-Orientation2.js", <!---JS links--->
        "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css", <!---CSS links--->
        "Step 2:  HR - Contractor Orientation 2", <!---Page Title--->
        "Status", <!---Active Nav Link--->
        "true" <!---Alternate menu.  Shows main EPAR links--->
    )#
    <!---HTML header, css links, js links, and page title--->
    
    
    <cfif Session.Auth EQ True and (Session.strAuthType EQ Session.LIAISONS or Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)>   
                
    	<h1 class="title">Step 2:   HR - Contractor Orientation 2</h1>
        <div class="entry">        
            
            <!---Query objects--->
            <cfset QUERIES = {
                GetEmpInfo = baseQueries.funcGetEmpInfo(URL.StepID),
				GetAccess = baseQueries.funcGetAccess(),
				GetContainer = baseQueries.funcGetContainer(),
				GetNonSCFTypes = nonSCFOrientation.funcGetNonSCFTypes(),
				GetDepts = baseQueries.funcGetDepts()				
            } />            
            <cfset QUERIES.GetCommentsByStepType = baseQueries.funcGetCommentsByStepType(QUERIES.GetEmpInfo.ID, 1) />
            <!---Query objects--->
            
            <cfset Name = QUERIES.GetEmpInfo.First>
			<cfif QUERIES.GetEmpInfo.PreferredName NEQ "">
                <cfset Name = Name & ' (' & QUERIES.GetEmpInfo.PreferredName & ')'>
            </cfif>
            <cfif QUERIES.GetEmpInfo.Middle NEQ "">
                <cfset Name = Name & ' ' & QUERIES.GetEmpInfo.Middle>
            </cfif>
            <cfset Name = Name & ' ' & QUERIES.GetEmpInfo.Last>                                            
            
            <cfif QUERIES.GetEmpInfo.recordcount GT 0>
            
            	Welcome, #Session.arrEmpInfo.FirstName# #Session.EmpInfo.LastName#.  
                On this page you'll be asked to review the information provided by the requesting contract supervisor.
            
            	<cfform name="frmStep2" method="post" action="api.cfm?api=update_nonscf_step2_employee">
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <fieldset>
                                    <legend><strong>Information provided by the Contract Supervisor:</strong></legend>
                                    <table>
                                        <tr>
                                            <td width ="10">&nbsp;</td>
                                            <td>Employee to Hire:</td>
                                            <td>#Name#</td>
                                        </tr>
                                        <tr>
                                            <td width = "10">&nbsp;</td>
                                            <td>&nbsp;&nbsp;&nbsp;&nbsp;First, MI, Last:</td>
                                            <td>
                                                <cfinput type="text" name="First" required="yes" message="Please provide a first name for this individual." tabindex="5" value="#QUERIES.GetEmpInfo.First#">
                                                <cfinput type="text" name="Middle" size=1 maxlength="2" required="no" tabindex="7" value="#QUERIES.GetEmpInfo.Middle#">                        	
                                                <cfinput type="text" name="Last" required="yes" message="Please provide a last name for this individual." tabindex="10" value="#QUERIES.GetEmpInfo.Last#">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;&nbsp;&nbsp;&nbsp;Preferred Name:</td>
                                            <td><cfinput type="text" name="PreferredName" tabindex="15" value="#QUERIES.GetEmpInfo.PreferredName#"></td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;&nbsp;&nbsp;&nbsp;SSN:</td>
                                            <td>
                                                <cfinput type="text" name="SSN" tabindex="17" value="#QUERIES.GetEmpInfo.SSN#" 
                                                required="yes" validate="social_security_number"  
                                                message="Please provide a valid SSN for this individual.">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>Requestors Comments:</td>
                                            <td>
                                                <cfif len(trim(QUERIES.GetCommentsByStepType.Notes)) GT 0 >
                                                    #QUERIES.GetCommentsByStepType.Notes#
                                                <cfelse>
                                                    <span class="error">None</span>
                                                </cfif>
                                            </td>                                
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>Supervisor:</td>
                                            <td>#SCF_Employee_ShowDropdown_AllEmployees('SupervisorID', QUERIES.GetEmpInfo.SupervisorID, 1, False, True, True, 18, "", False, "", True)#</td>
                                        </TR>
                                        <TR>
                                            <td>&nbsp;</td>
                                            <TD>Department:</TD>
                                            <TD colspan=3>
                                                <cfselect name="DeptID" query="QUERIES.GetDepts" tabindex="20" value="OrgCodeIDNo" display="Org" Selected ="#QUERIES.GetEmpInfo.DeptID#"/>
                                            </TD>
                                        </TR>   
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>Non-SCF Type:</td>
                                            <td>
                                                <cfselect name="NonSCFTypeID" query="QUERIES.GetNonSCFTypes" tabindex="30" value="ID" display="Type" selected="#QUERIES.GetEmpInfo.NonSCFTypeID#"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>Company Name:</td>
                                            <td>
                                                <cfinput type="text" name="CompanyName" tabindex="40" tooltip="'Volunteer' or Contracted Company Name." 
                                                value="#QUERIES.GetEmpInfo.CompanyName#" required="yes" 
                                                message="Please provide a Company for this individual.  Type 'Volunteer' for volunteers or use the Company the contractor works for." >
                                            </td>
                                        </tr>
                                        <TR>
                                            <td>&nbsp;</td>
                                            <TD valign="top"> Actual Start Date:</TD>
                                            <TD>
                                                <cfinput type="hidden" name="EstStartDate" 
                                                value="#DateFormat(QUERIES.GetEmpInfo.EstStartDate, 'mm/dd/yyyy')#"
                                                error_message="The Expiration Date cannot exceed 6 months from the current day."/>
                            					<div id="EstStartDate_datepicker"></div>                                                
                                            </TD>
                                        </TR>  
                                        <tr>
                                            <td colspan="4">
                                                <fieldset>
                                                <legend><strong>Network Account and Badge Information:</strong></legend>
                                                    <table>
                                                        <tr>
                                                            <td colspan=5>
                                                                <input type="checkbox" id="NA" tabindex="60" <cfif QUERIES.GetEmpInfo.NonSCFNetworkAccount eq 1>checked="yes"</cfif>> Network Account<br />
                                                                <div ID="NA" >
                                                                    <table>
                                                                        <tr>
                                                                            <td width="25">&nbsp;</td>
                                                                            <td>Network Account to Mirror:</td>
                                                                            <td>#SCF_Employee_ShowDropdown_AllEmployees(
                                                                            	'MirrorAccountID', QUERIES.GetEmpInfo.MirrorAccountID, 1, False, True, True, 70, "", False, "", True
                                                                            )#
                                                                            </td>
                                                                            <td>&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                        	<td width="25">&nbsp;</td>
                                                                            <td>Phone Ext:</td>
                                                                            <td>                                                                        
                                                                                <cfinput type="text" name="DeskPhone" maxlength="6" 
                                                                                tabindex="80" 
                                                                                tooltip="If a phone already exists at the employees work station, what is the 4 digit extension?" 
                                                                                value="#QUERIES.GetEmpInfo.DeskPhone#">
                                                                            </td>
                                                                        </tr>
                                                                        <TR>
                                                                            <td>&nbsp;</td>
                                                                            <TD>Location/Container:</TD>
                                                                            <TD>
                                                                                <cfselect name="ContainerID" query="QUERIES.GetContainer" tabindex="90" 
                                                                                value="OUID" display="Container" 
                                                                                selected="#QUERIES.GetEmpInfo.ContainerID#"/>
                                                                            </TD>
                                                                        </TR>
                                                                   </table>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan=5>
                                                                <input type="checkbox" id="Badge" tabindex="100" <cfif QUERIES.GetEmpInfo.NonSCFBadge eq 1>checked="yes"</cfif>> Badge<br />
                                                                <div ID="Badge" Name="Badge">
                                                                    <table>
                                                                        <tr>
                                                                            <td width="25">&nbsp;</td>
                                                                            <td valign="top">Position (Badge):</td>
                                                                            <td>
                                                                                <cfinput type="text" name="BadgePos" tabindex="110" 
                                                                                tooltip="Enter the Position as it should appear on the Badge" value="#QUERIES.GetEmpInfo.BadgePos#" 
                                                                                style="width:98%" message="Please enter the Position as it should appear on the Badge.">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td valign="top">Badge Level Access:</td>
                                                                            <td>
                                                                            	<cfselect name="BadgeAccessLevelID" tabindex="105"  multiple="yes">
                                                                                    <cfif arrayLen(listtoArray(QUERIES.GetEmpInfo.BadgeAccessLevelID)) GT 0>
                                                                                        <option id="0">-- None --</option>
                                                                                    <cfelse>
                                                                                        <option id="0" selected="selected">-- None --</option>
                                                                                    </cfif>
                                                                                    <cfloop query="QUERIES.GetAccess">
                                                                                        <cfif arrayLen(listtoArray(QUERIES.GetEmpInfo.BadgeAccessLevelID)) GT 0>
                                                                                        	<cfset Selected = "">
                                                                                            <cfloop from='1' to='#arrayLen(listtoArray(QUERIES.GetEmpInfo.BadgeAccessLevelID))#' index="i">
                                                                                            	<cfset accessList = listtoArray(QUERIES.GetEmpInfo.BadgeAccessLevelID) />
                                                                                                <cfif AccessLvID EQ accessList[i]>
                                                                                                	<cfset Selected = "selected=Selected">
                                                                                                </cfif>
                                                                                            </cfloop>
                                                                                            <option value="#AccessLvID#" #Selected#>#Descript#</option>
                                                                                        <cfelse>
                                                                                            <option value="#AccessLvID#">#Descript#</option>
                                                                                        </cfif>                                                                                        
                                                                                    </cfloop>
                                                                                </cfselect>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                            </td>
                                                        </tr>   
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr> 
                                        <TR>
                                            <td>&nbsp;</td>
                                            <TD valign="top">Comments:</TD>
                                            <TD colspan=3>
                                                <cftextarea rows="2" tabindex="130" name="Comments" style="width:98%" value="#QUERIES.GetCommentsByStepType.Notes#"/>
                                            </TD>
                                        </TR>                             
                                    </table>     
                                </fieldset>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;
                                
                            </td>
                       </tr>
                        <tr>
                            <td colspan="5" align="right" valign="middle" style="padding-top:5px;">
                                <cfinput type="hidden" name="EmpID" value="#QUERIES.GetEmpInfo.ID#">
                                <cfinput type="hidden" name="StepID" value="#URL.StepID#">
                                <cfinput type="button" name="Submit" value="Next >>" tabindex="150">
                            </td>
                        </tr>
                </table>
            </cfform>
            
			<cfelse>
            	This employee has already been processed.   To select another user, click <a href="Step2-PreOrientation1.cfm">Here</a>
            </cfif>
        
        
        </div>
        
        
    
    <cfelse>
        <cfinclude template="../denied.cfm">
    </cfif>
    
    
    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
    #BASE.htmlFooterNonSCF()#
    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>